// 个人日报详情控制器
define('workDetailsController', ['angular','jquery','datetimepicker','moment'], function (angular,$,datetimepicker,moment) {
    var module = angular.module('controllers');
    module.controller('workDetailsController', ['$scope','$routeParams','$filter','$route','dailyServers',function ($scope,$routeParams,$filter,$route,dailyServers) {
      	var dailyId=$routeParams.id;
        var data={};
        data.id=dailyId;

        dailyServers.searchWork(data).then(function(dt) {
            $scope.workDetailData=dt[0];
            console.log($scope.workDetailData);
        });
        //修改
        $scope.setMeetingForm=function(valid){
            delete $scope.workDetailData.name;
            $scope.workDetailData = $filter('simplifyJsonFilter')($scope.workDetailData);

            dailyServers.setMeetingList($scope.workDetailData).then(function (data) {
                if(data){
                        $route.reload($scope.workDetailData);
                    }else{
                        alert("添加失败");
                    }
            });
        };
    }]);
});
